# !/usr/bin/env python
# -*- coding: UTF-8 -*-
from flask import g
from flask_wtf import Form
from wtforms import TextAreaField, SelectField, PasswordField, RadioField, TextField, HiddenField, \
    IntegerField, FileField
from wtforms.validators import DataRequired, Regexp, EqualTo, InputRequired
from ..utils.helper import validate_user_info


class DiyModalForm(Form):
    """自定义模型form"""
    opt = RadioField('', choices=[(1, '矩形'), (2, '柱状'), (3, '椭圆'), (4, '菱形')], default=1)
    cate_p = SelectField('模型属性', coerce=int)
    title = TextField('标题', default='')
    v = RadioField('', choices=[(1, '点击式'), (2, '拖拽式')], default=1)
    width = TextField('宽度', default='')
    height = TextField('高度', default='')
    pages = IntegerField('页数', default=1)
    color = TextField('颜色', default='')
    color_full = TextField('颜色应用', default=1)
    rad_d = RadioField('', choices=[(1, '直线'), (2, '外圆弧'), (3, '内圆弧')], default=2)
    rad = TextField('切角大小', default='')
    file_format = RadioField('', choices=[('jpg', 'jpg'), ('png', 'png'), ('bmp', 'bmp')], default=1)
    offset  = TextField('杯把宽度', default=2)
    content = TextAreaField('内容', validators=[DataRequired('内容不能为空')])
    upload_img = HiddenField()
